<template>
  <div class="game">
    <h2>游戏姓名:{{name}}</h2>
    <h2>游戏地址:{{address}}</h2>
    <button @click="sendGameName">把游戏名给app</button>
  </div>
</template>

<script>
export default {
    name:'Game',
    data(){
        return{
            name:'光与夜之恋',
            address:'光启市'
        }
    },
    props:['getGameName'],
    methods:{
        sendGameName(){
            this.getGameName(this.name)
        }
    }
}
</script>

<style>
    .game{
        background-color: skyblue;
        padding:5px;
    }
</style>